﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="RegisterDispatch.aspx.cs" Inherits="AdminPages_RegisterDispatch" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" 
        onrowcommand="GridView1_RowCommand">
        <Columns>
            <asp:BoundField DataField="MovieID" HeaderText="MovieID" InsertVisible="False" 
                ReadOnly="True" SortExpression="MovieID" />
            <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
            <asp:BoundField DataField="Priority" HeaderText="Priority" 
                SortExpression="Priority" />
            <asp:BoundField DataField="UserName" HeaderText="UserName" 
                SortExpression="UserName" />
            <asp:BoundField DataField="DVDStockID" HeaderText="DVDStockID" 
                InsertVisible="False" ReadOnly="True" SortExpression="DVDStockID" />
            <asp:ButtonField ButtonType="Button" CommandName="dispatch" Text="Dispatch" />
        </Columns>
        <EmptyDataTemplate>
            No data available
        </EmptyDataTemplate>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString %>" 
        
    
    SelectCommand="SELECT Movie.MovieID, Movie.Title, RentalListMovies.Priority, Customer.UserName, DVDStock.DVDStockID FROM Movie INNER JOIN DVDStock ON Movie.MovieID = DVDStock.MovieID INNER JOIN RentalListMovies ON Movie.MovieID = RentalListMovies.MovieID INNER JOIN Customer ON RentalListMovies.CustomerID = Customer.CustomerID WHERE (Customer.DVDRented = 0) AND (RentalListMovies.Priority &lt; 5) AND (DVDStock.Availability = 1)">
    </asp:SqlDataSource>
</asp:Content>

